package algorithm.easy;

public class Solution136 {

    // 输入: [4,1,2,1,2]
    //输出: 4
    public static int singleNumber(int[] nums) {
        int res = 0;
        for(int i=0;i<nums.length;i++){
            res = res^nums[i];
        }
        return res;
    }
    public static void main(String[] args){
        int[] nums = {4,1,2,1,2};
        System.out.println(singleNumber(nums));

    }
}
